home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_400
/
424_02
/
ED-157
/
handy.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-09-10
|
498b
|
9 lines
/* Included by: CALC_LIMITS CHANGE_CASE EDIT INIT_TERIMINAL INSERT_WINDOW */
#define max(x,y) (((x)>=(y))?(x):(y)) /* maximum of two things */
#define min(x,y) (((x)<=(y))?(x):(y)) /* minimum of two things */
#ifndef _AIX
#define abs(x) (((x)>=0)?(x):(-(x))) /* absolute value (assumes correct promotion of 0 by compiler) */
#endif
#define roundup(n,b) ((((n)+(b)-1)/(b))*(b)) /* round n up to the next multiple of b */
#define truncate(n,b) (((n)/(b))*(b)) /* round n down to a multiple of b */